from common.entitys.monitor import Monitor
from database.mapper import stock_day_k
from utils import parse_util, caiptal_util, date_util, cache_util, statisticalutil, dict_util, ave_util


#
def expect(monitor: Monitor):
    print('预计走势')
    # 相关性分析
    # 均线相关性
    range_list = [4, 5, 6, 7, 8, 9, 10, 14, 18, 20]
    sp_list = parse_util.list_dict_to_list(monitor.get_all_k_line(), 'sp')
    # 均线天数
    for n in range_list:
        # 纵向天数
        for i in range(10, 15):
            # 纵向比较
            ave_list = ave_util.get_ave_x(sp_list, n)
            print(statisticalutil.correlation([1, 2, 3, 4, 5, 6, 7, 8],
                                              [10, 20, 30, 40, 50, 60, 70, 80]))

    # price相关性分析
    # macd相关性分析
    # io_flow相关性


if __name__ == '__main__':
    expect(Monitor('600031', ''))
